import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import indexPage from "@/views/indexPage.vue";
import inlineStyle from "@/views/inlineStyle.vue";
import vforKey from "@/views/vforKey.vue";
import ifShow from "@/views/ifShow.vue";
import brandCase from "@/views/brandCase.vue";
import boardDecoration from "@/views/boardDecoration.vue";
import filterPage from "@/views/filterPage.vue";
import customDirectives from "@/views/customDirectives.vue";
import lifeCycle from "@/views/lifeCycle.vue";
import axiosPage from "@/views/axiosPage.vue";
import assemblyPage from "@/views/assemblyPage.vue";
import indexvuePage from "@/views/indexvuePage.vue";
import animationPage from "@/views/animationPage.vue";
import refPage from "@/views/refPage.vue";
import pageA from "@/views/pageA.vue";
import pageB from "@/views/pageB.vue";
import pageC from "@/views/pageC.vue";
import computedPage from "@/views/computedPage.vue";




Vue.use(VueRouter)


const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    // 重定向：从path页面定向到indexvue页面
    path:'/',
    redirect:'/indexvue'
  },
  {
    path:'/index',
    component:indexPage
  },
  {
    path:'/inline',
    component:inlineStyle
  },
  {
    path:'/pageA',
    component:pageA
  },
  {
    path:'/pageB',
    component:pageB
  },
  {
    path:'/pageC',
    name:'pageC',
    component:pageC
  },
  {
    path:'/computed',
    component:computedPage
  },
  {
    path:'/key',
    component:vforKey
  },
  {
    path:'/ifsh',
    component:ifShow
  },
  {
    path:'/brand',
    component:brandCase
  },
  {
    path:'/board',
    component:boardDecoration
  },
  {
    path:'/ref',
    component:refPage
  },
  {
    path:'/filter',
    component:filterPage
  },
  {
    path:'/custom',
    component:customDirectives
  },
  {
    path:'/life',
    component:lifeCycle
  },
  {
    path:'/axios',
    component:axiosPage
  },
  {
    path:'/assembly',
    component:assemblyPage
  },
  {
    path:'/indexvue',
    component:indexvuePage
  },
  {
    path:'/animation',
    component:animationPage
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
  linkActiveClass:'active'
})

export default router
